package com.falm.picturebackend.entity.enums;

public enum UserRoleEnum {

    ADMIN("admin", "0", "管理员"),

    USER("user", "1", "普通用户");

    private String role;
    private String value;
    private String describe;

    UserRoleEnum(String role, String value, String describe) {
        this.role = role;
        this.value = value;
        this.describe = describe;
    }

    public static UserRoleEnum codeOf(String value) {
        for (UserRoleEnum roleEnum : values()) {
            if (roleEnum.value.equals(value)) {
                return roleEnum;
            }
        }
        return null;
    }

    public String getRole() {
        return role;
    }

    public String getValue() {
        return value;
    }

    public String getDescribe() {
        return describe;
    }
}
